package ltd.hxya.novel.common.exception;


import ltd.hxya.novel.common.bean.ResultEnum;

public class NovelGlobalException extends RuntimeException {
    private Integer code;
    private Object message;

    public String getMessage() {
        return (String) message;
    }

    public Integer getCode() {
        return code;
    }

    public NovelGlobalException(Integer code, Object msg) {
        this.code = code;
        this.message = msg;
    }
    public NovelGlobalException(ResultEnum resultEnum){
        this.code = resultEnum.getCode();
        this.message=resultEnum.getMsg();
    }
}
